package com.example.flow.flow.model;


import com.example.flow.flow.core.Execution;

import java.util.List;

/**
 * @author tangaq
 * 2023/6/13
 */
public class TaskModel extends NodeModel {
    private static final long serialVersionUID = -2824218614911628325L;
    private Integer allowStop;
    // EnumDefaultApproveUserType审批人类型 1--api自定义，2--申请人选择，3--上一审批人选择，4--模板指定，5--主管
    private Integer approverType;
    // 审批人列表仅approverType=4有值
    private List<String> approver;
    // 当前审批人guid
    private String currentOperatorGuid;
    // 当前审批人名称
    private String currentOperatorName;

    public TaskModel() {
    }

    public TaskModel(TaskParse taskParse) {
        this.setName(taskParse.getName());
        this.allowStop = taskParse.getAllowStop();
        this.approverType = taskParse.getApproverType();
        this.approver = taskParse.getApprover();
    }

    @Override
    protected void exec(Execution execution) {
        runNextNode(execution);
    }

    public Integer getAllowStop() {
        return allowStop;
    }

    public void setAllowStop(Integer allowStop) {
        this.allowStop = allowStop;
    }

    public Integer getApproverType() {
        return approverType;
    }

    public void setApproverType(Integer approverType) {
        this.approverType = approverType;
    }

    public List<String> getApprover() {
        return approver;
    }

    public void setApprover(List<String> approver) {
        this.approver = approver;
    }

    public String getCurrentOperatorGuid() {
        return currentOperatorGuid;
    }

    public void setCurrentOperatorGuid(String currentOperatorGuid) {
        this.currentOperatorGuid = currentOperatorGuid;
    }

    public String getCurrentOperatorName() {
        return currentOperatorName;
    }

    public void setCurrentOperatorName(String currentOperatorName) {
        this.currentOperatorName = currentOperatorName;
    }
}
